home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 November / Chip Kasım 2003.iso / prog / openoff / f_0244 / common.jar / text / common / explorer / database / 02010100.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  59.8 KB  |  661 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>Query Design</title><meta name="filename" content="text/common/explorer/database/02010100"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         table.Tabelle4{
  5.                 }
  6.         span.Tabelle4A{
  7.                 width:1.499cm;}
  8.         span.Tabelle4B{
  9.                 width:16.499cm;}
  10.         table.Tabelle11{
  11.                 }
  12.         span.Tabelle11A{
  13.                 width:1.499cm;}
  14.         span.Tabelle11B{
  15.                 width:16.498cm;}
  16.         tr.Tabelle111{
  17.                 }
  18.         td.Tabelle11A1{
  19.                 }
  20.         table.Tabelle6{
  21.                 }
  22.         span.Tabelle6A{
  23.                 width:1.499cm;}
  24.         span.Tabelle6B{
  25.                 width:16.498cm;}
  26.         tr.Tabelle61{
  27.                 }
  28.         td.Tabelle6A1{
  29.                 }
  30.         table.Tabelle8{
  31.                 margin-left:0cm; margin-right:0.005cm;}
  32.         span.Tabelle8A{
  33.                 width:3.246cm;}
  34.         span.Tabelle8B{
  35.                 width:2.328cm;}
  36.         span.Tabelle8C{
  37.                 width:12.418cm;}
  38.         td.Tabelle8A1{
  39.                 }
  40.         td.Tabelle8C1{
  41.                 border-width:0.002cm; border-style:solid; border-color:#000000;}
  42.         td.Tabelle8A2{
  43.                 }
  44.         td.Tabelle8C2{
  45.                 }
  46.         table.Tabelle9{
  47.                 }
  48.         span.Tabelle9A{
  49.                 width:1.499cm;}
  50.         span.Tabelle9B{
  51.                 width:16.498cm;}
  52.         tr.Tabelle91{
  53.                 }
  54.         td.Tabelle9A1{
  55.                 }
  56.         table.Tabelle1{
  57.                 margin-left:0cm; margin-right:0.005cm;}
  58.         span.Tabelle1A{
  59.                 width:3cm;}
  60.         span.Tabelle1C{
  61.                 width:11.989cm;}
  62.         td.Tabelle1A1{
  63.                 }
  64.         td.Tabelle1C1{
  65.                 border-width:0.002cm; border-style:solid; border-color:#000000;}
  66.         td.Tabelle1A2{
  67.                 }
  68.         td.Tabelle1C2{
  69.                 }
  70.         table.Tabelle2{
  71.                 margin-left:0cm; margin-right:0.005cm;}
  72.         span.Tabelle2A{
  73.                 width:3cm;}
  74.         span.Tabelle2D{
  75.                 width:8.987cm;}
  76.         td.Tabelle2A1{
  77.                 }
  78.         td.Tabelle2D1{
  79.                 border-width:0.002cm; border-style:solid; border-color:#000000;}
  80.         td.Tabelle2A2{
  81.                 }
  82.         td.Tabelle2D2{
  83.                 }
  84.         table.Tabelle3{
  85.                 margin-left:0cm; margin-right:0.005cm;}
  86.         span.Tabelle3A{
  87.                 width:5.009cm;}
  88.         span.Tabelle3B{
  89.                 width:12.98cm;}
  90.         td.Tabelle3A1{
  91.                 }
  92.         td.Tabelle3B1{
  93.                 border-width:0.002cm; border-style:solid; border-color:#000000;}
  94.         td.Tabelle3A2{
  95.                 }
  96.         td.Tabelle3B2{
  97.                 }
  98.         table.Tabelle14{
  99.                 }
  100.         span.Tabelle14A{
  101.                 width:2.99cm;}
  102.         span.Tabelle14B{
  103.                 width:15.007cm;}
  104.         td.Tabelle14A1{
  105.                 }
  106.         td.Tabelle14B1{
  107.                 border-width:0.002cm; border-style:solid; border-color:#000000;}
  108.         td.Tabelle14A2{
  109.                 }
  110.         td.Tabelle14B2{
  111.                 }
  112.         table.Tabelle15{
  113.                 }
  114.         span.Tabelle15A{
  115.                 width:2.99cm;}
  116.         span.Tabelle15B{
  117.                 width:15.007cm;}
  118.         td.Tabelle15A1{
  119.                 }
  120.         td.Tabelle15B1{
  121.                 border-width:0.002cm; border-style:solid; border-color:#000000;}
  122.         td.Tabelle15A2{
  123.                 }
  124.         td.Tabelle15B2{
  125.                 }
  126.         table.Tabelle12{
  127.                 margin-left:0cm; margin-right:0.005cm;}
  128.         span.Tabelle12A{
  129.                 width:2.046cm;}
  130.         span.Tabelle12B{
  131.                 width:4.304cm;}
  132.         span.Tabelle12C{
  133.                 width:11.643cm;}
  134.         td.Tabelle12A1{
  135.                 }
  136.         td.Tabelle12C1{
  137.                 border-width:0.002cm; border-style:solid; border-color:#000000;}
  138.         td.Tabelle12A2{
  139.                 }
  140.         td.Tabelle12C2{
  141.                 }
  142.         td.Tabelle12B3{
  143.                 }
  144.         table.Tabelle13{
  145.                 }
  146.         span.Tabelle13A{
  147.                 width:1.499cm;}
  148.         span.Tabelle13B{
  149.                 width:16.498cm;}
  150.         tr.Tabelle131{
  151.                 }
  152.         td.Tabelle13A1{
  153.                 }
  154.         table.Tabelle5{
  155.                 }
  156.         span.Tabelle5A{
  157.                 width:1.499cm;}
  158.         span.Tabelle5B{
  159.                 width:16.498cm;}
  160.         tr.Tabelle51{
  161.                 }
  162.         td.Tabelle5A1{
  163.                 }
  164.         table.Tabelle10{
  165.                 }
  166.         span.Tabelle10A{
  167.                 width:1.499cm;}
  168.         span.Tabelle10B{
  169.                 width:16.498cm;}
  170.         tr.Tabelle101{
  171.                 }
  172.         td.Tabelle10A1{
  173.                 }
  174.         p.P1{
  175.                 }
  176.         p.P2{
  177.                 }
  178.         p.P3{
  179.                 }
  180.         p.P4{
  181.                 }
  182.         span.T1{
  183.                 font-weight:bold;}
  184.         span.fr1{
  185.                 }
  186.         span.fr2{
  187.                 }
  188.         span.fr3{
  189.                 }
  190.         </style></head><body>
  191.    
  192.    
  193.    <p class="P1"/>
  194.    <p class="Head1"><help:help-id value="ID_SBA_QUERYDESIGNVIEWSH" xmlns:help="http://openoffice.org/2000/help"/><help:help-id value="ID_SBA_QUERYBROWSEVIEWSH" xmlns:help="http://openoffice.org/2000/help"/><help:help-id value="ID_SBA_QUERYTXTVIEWSH" xmlns:help="http://openoffice.org/2000/help"/><help:help-id value="HID_TLB_QRYDESIGN" xmlns:help="http://openoffice.org/2000/help"/><help:help-id value="HID_OFA_CHAOS_QUERY_NEWDESIGNQUERY" xmlns:help="http://openoffice.org/2000/help"/><a name="entwurfab"/><help:link Id="66162" xmlns:help="http://openoffice.org/2000/help">Query Design</help:link></p>
  195.    <p class="Paragraph"><help:key-word value="queries; creating" tag="kw66162_6" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="queries; editing" tag="kw66162_20" xmlns:help="http://openoffice.org/2000/help"/><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">In the design view of a query you have the possibility of creating a new query or editing an existing query.</help:help-text><a name="ende"/></p>
  196.    <table><tr class=""><th style="text-align:left;"><span class="Tabelle4A">
  197.        <p class="Paragraph"><draw:image draw:style-name="fr1" draw:name="Grafik1" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="1" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  198.       </span></th><th style="text-align:left;"><span class="Tabelle4B">
  199.        <p class="Paragraph">A number of databases also support the creation of a new table view. With the <span class="T1">New view design</span> context menu command in a table container of such a database you see the <span class="T1">View</span> window that resembles the <span class="T1">Query</span> window described here.</p>
  200.       </span></th></tr></table>
  201.    <help:popup Id="67813" Eid="entwab" xmlns:help="http://openoffice.org/2000/help"><help:embedded Id="65598" Eid="wie"/></help:popup>
  202.    <p class="Head2">The Design View<help:key-word value="design view; queries" tag="kw66162_19" xmlns:help="http://openoffice.org/2000/help"/></p>
  203.    <p class="Paragraph">To create a query, <help:link Id="66162" Eid="tabellenauswaehlen" xmlns:help="http://openoffice.org/2000/help">select the tables</help:link> containing relevant data for the query. These tables will be displayed in the upper border of the query view. This enables you to define possible <help:link Id="66162" Eid="beziehungen" xmlns:help="http://openoffice.org/2000/help">relationships</help:link> between the tables in this area</p>
  204.    <p class="Paragraph">The lower area of the Design View serves for the actual <help:link Id="66162" Eid="abfragedefinieren" xmlns:help="http://openoffice.org/2000/help">query definition</help:link>. To define the query, specify which <help:link Id="66162" Eid="datenfelder" xmlns:help="http://openoffice.org/2000/help">field names</help:link> will be accepted into the query and the <help:link Id="66162" Eid="kriterien" xmlns:help="http://openoffice.org/2000/help">criteria</help:link> by which these fields should be displayed.</p>
  205.    <p class="Paragraph">In the top of the query design certain <help:link Id="65564" xmlns:help="http://openoffice.org/2000/help">Symbols</help:link> make various functions available to you. Thus, for example, you can execute a query that has been created in order to check it.</p>
  206.    <p class="Head2"><a name="tabellenauswaehlen"/>BROWSE</p>
  207.    <p class="Paragraph">When you open the query design for the first time, in order to create a new query, you can click <help:link Id="65934" xmlns:help="http://openoffice.org/2000/help"><span class="T1">Add Tables</span></help:link>. You then see a dialog in which you must first select the tables on the basis of which you want to create a query.</p>
  208.    <p class="Paragraph"><help:help-id value="HID_CTL_QRYDGNTAB" xmlns:help="http://openoffice.org/2000/help"/><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">In the tables window the data fields of the selected tables are listed.</help:help-text></p>
  209.    <table><tr class="Tabelle111"><th class="Tabelle11A1" style="text-align:left;"><span class="Tabelle11A">
  210.        <p class="Paragraph"><draw:image draw:style-name="fr2" draw:name="HIND_4" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="2" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  211.       </span></th><th class="Tabelle11A1" style="text-align:left;"><span class="Tabelle11B">
  212.        <p class="Paragraph">While designing a query you will not be able to modify the selected tables. This guarantees that the tables cannot be modified when a query is created. Even if you select a table and then remove it, this table will be still be locked for the table design</p>
  213.       </span></th></tr></table>
  214.    <p class="Head3">Remove tables</p>
  215.    <p class="Paragraph">To remove the table from Design View, click the upper border of the table window and display the context menu. You can use the <span class="T1">Delete</span> command to remove the table from the Design View. Another option is to press the (Del) key.</p>
  216.    <help:to-be-embedded Eid="darstellungaendern" xmlns:help="http://openoffice.org/2000/help">
  217.    <p class="Head3">Move table and modify table size</p>
  218.    <p class="Paragraph">You can resize and arrange the tables according to your preferences. To move tables, drag the upper border to the desired position. Enlarge or reduce the size in which the table is displayed by positioning the mouse cursor on a border or on a corner and dragging the table until it is the desired size.</p>
  219.    </help:to-be-embedded>
  220.    <p class="Head2"><a name="beziehungen"/><help:key-word value="joining tables" tag="kw66162_18" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="tables; joining for queries" tag="kw66162_17" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="queries; joining tables" tag="kw66162_16" xmlns:help="http://openoffice.org/2000/help"/>Table Relations</p>
  221.    <p class="Paragraph">If there are data relations between a field name in one table and a field name in another table, you can use these relations for your query.</p>
  222.    <p class="Paragraph">If, for example, you have a spreadsheet for articles in which each article is clearly identified by an article number, and a spreadsheet for customers in which you record all articles that a customer orders, using the appropriate article numbers, then there is a relationship between the two "article number" data fields. <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>If you now want to create a query, that returns all articles that a customer has ordered, you must retrieve data from two spreadsheets. To do this, you must tell <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> what the relationship is between the data in the two spreadsheets.</p>
  223.    <p class="Paragraph">To do this, click a field name in a table (for example, the field name "Item-Number" from the Customer table), hold down the mouse button and then drag the field name to the field name of the other table ("Item-Number" from the Item table). When you release the mouse button you will see a line connecting the two fields in the two windows. The corresponding condition that the content of the two field names must be identical is entered in the resulting SQL query.</p>
  224.    <table><tr class="Tabelle61"><th class="Tabelle6A1" style="text-align:left;"><span class="Tabelle6A">
  225.        <p class="Paragraph"><draw:image draw:style-name="fr2" draw:name="HIND_3" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="3" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  226.       </span></th><th class="Tabelle6A1" style="text-align:left;"><span class="Tabelle6B">
  227.        <p class="Paragraph">The creation of a query that is based in several sheets that relate to each other, is only possible if you use <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> as the interface for a relational database such as Adabas.</p>
  228.        <p class="Paragraph">You cannot access tables from different databases in a query. Queries involving multiple tables can only be created within a database.</p>
  229.       </span></th></tr></table>
  230.    <p class="Head3"><help:key-word value="Specifying link type" tag="kw66162_1" xmlns:help="http://openoffice.org/2000/help"/>Specifying link type</p>
  231.    <p class="Paragraph">If you double-click a line connecting the two linked fields, you can specify the type of link in the <help:link Id="66175" xmlns:help="http://openoffice.org/2000/help">Joint Properties</help:link> dialog.</p>
  232.    <p class="Head3"><help:key-word value="Query: delete table links" tag="kw66162_15" xmlns:help="http://openoffice.org/2000/help"/>Deleting relations</p>
  233.    <p class="Paragraph">To delete a relation between two tables, click the connection line and then press the (Del) key.</p>
  234.    <p class="Head2"><help:help-id value="HID_CTL_QRYDGNCRIT" xmlns:help="http://openoffice.org/2000/help"/><a name="abfragedefinieren"/>Define query</p>
  235.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">The query is defined in the lower area of the design view.</help:help-text> Each column of the design table accepts a data field for the query. You can define the conditions for each data field in the table rows. The query will be created according to those conditions. The conditions in one row are linked with a Boolean AND.</p>
  236.    <p class="Head3"><a name="datenfelder"/>Specify field name</p>
  237.    <p class="Paragraph">First select all field names from the tables that you want to add to the query. You can do this either with Drag&Drop or by double-clicking a field name in the table window. With the Drag&Drop method, you use the mouse to drag a field name of a table window into the lower area of the query design. As you do this you can decide which column you want to add the field in question to. Select a field name by double-clicking. It will then be added to the next free column.</p>
  238.    <p class="Head3">Deleting field names</p>
  239.    <p class="Paragraph">To remove a field name from the query, click the column header of the field and choose the <span class="T1">Delete</span> command on the context menu for the column.</p>
  240.    <p class="Head3">Save query</p>
  241.    <p class="Paragraph">Use the <span class="T1">Save</span> icon on the function bar to save the query. You see a dialog that asks you to enter a name for the query. If the database supports schemas, you can also enter a schema.</p>
  242.    <p class="Head4"><help:help-id value="DBACCESS_COMBOBOX_DLG_SAVE_AS_ET_SCHEMA" xmlns:help="http://openoffice.org/2000/help"/>Schema</p>
  243.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Enter the name of the schema that is assigned to the query/table view.</help:help-text></p>
  244.    <p class="Head4"><help:help-id value="DBACCESS_EDIT_DLG_SAVE_AS_ET_TITLE" xmlns:help="http://openoffice.org/2000/help"/>Query / table view name.</p>
  245.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Enter the name of the query / table view.</help:help-text></p>
  246.    <p class="Head3"><a name="kriterien"/>Filtering data</p>
  247.    <p class="Paragraph">To filter data for the query, set the desired preferences in the lower area of the Design View. The following lines are available for you here:</p>
  248.    <p class="Head4"><help:help-id value="HID_QRYDGN_ROW_FIELD" xmlns:help="http://openoffice.org/2000/help"/>Field</p>
  249.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Enter here the name of the data field to which you referred in the Query. All settings made in the lower rows, refer to this field.</help:help-text> If you activate a cell with a mouse click you'll see an arrow button, which enables you to select a field. The "Table name.*" option selects all data fields and the criteria is valid for all table fields.</p>
  250.    <p class="Head4"><help:help-id value="HID_QRYDGN_ROW_ALIAS" xmlns:help="http://openoffice.org/2000/help"/>Alias</p>
  251.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">You can enter here an alias. This alias will be listed in a query instead of the field name. By this means, it is possible to use user defined column labels.</help:help-text> For example, if the data field in the table has the "ArticleNr" label and instead of that name, you would like to have <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>the name "Article-Number" to appear in the query, enter "Article-Number" as alias (without the quotation marks).</p>
  252.    <p class="Paragraph">In an SQL statement alias are defined as following:</p>
  253.    <p class="Paragraph">SELECT column AS alias FROM table.</p>
  254.    <p class="Paragraph">Thus, for example</p>
  255.    <p class="Paragraph">SELECT "ItemNo" AS Item-Number FROM "Item"</p>
  256.    <p class="Head4"><help:help-id value="HID_QRYDGN_ROW_TABLE" xmlns:help="http://openoffice.org/2000/help"/>Table</p>
  257.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">The respective database table of the selected data field is listed here.</help:help-text> If you activate the a cell with a mouse click, an arrow will appear which enables you to select another table of the current query.</p>
  258.    <p class="Head4"><help:help-id value="HID_QRYDGN_ROW_ORDER" xmlns:help="http://openoffice.org/2000/help"/>Sort</p>
  259.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">If you click the cell, you can select among the sorting options: ascending, descending and not sorted.</help:help-text> Text fields will be sorted alphabetically (A to Z) and numerical fields numerically (0 to 9).</p>
  260.    <p class="Head4"><help:help-id value="HID_QRYDGN_ROW_VISIBLE" xmlns:help="http://openoffice.org/2000/help"/>Visible</p>
  261.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">If you mark the <span class="T1">Visible</span> property for a data field, that field will be visible in the query</help:help-text>. If you only use a data field to formulate a condition, you do not necessarily need to show it.</p>
  262.    <p class="Head4"><help:help-id value="HID_QRYDGN_ROW_CRIT" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="criteria" tag="kw66162_14" xmlns:help="http://openoffice.org/2000/help"/>Criteria</p>
  263.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Enter here a <help:link Id="66162" Eid="sqlbefehle">criteria </help:link>after which the content of the data field should be filtered.</help:help-text></p>
  264.    <p class="Head4">or</p>
  265.    <p class="Paragraph">Here you can enter one additional criterion for filtering in each line. Multiple criteria in one column will be connected by an OR link.</p>
  266.    <p class="Paragraph">You can also use the context menu of the line headers in the lower area of the query design to insert another line for functions:</p>
  267.    <p class="Head3"><help:help-id value="HID_QRYDGN_ROW_FUNCTION" xmlns:help="http://openoffice.org/2000/help"/><a name="aggregatfunktionen"/>Functions</p>
  268.    <p class="Paragraph"><help:help-text value="hide" xmlns:help="http://openoffice.org/2000/help">Select a function to run in the query here.</help:help-text> You have various possibilities to run functions in queries. These possibilities depend on the used database system. If you are working with databases in Adabas format, the list box in the <span class="T1">Function</span> row offers you the following options (activate the visibility of the <span class="T1">Function</span> row via the context menu):</p>
  269.    <table border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" page-break-inside="page-break-inside:avoid"><tr class=""><th class="Tabelle8A1" style="text-align:left;"><span class="Tabelle8A">
  270.        <p class="TableHead">Option</p>
  271.       </span></th><th class="Tabelle8A1" style="text-align:left;"><span class="Tabelle8B">
  272.        <p class="TableHead">SQL</p>
  273.       </span></th><th class="Tabelle8C1" style="text-align:left;"><span class="Tabelle8C">
  274.        <p class="TableHead">Effect</p>
  275.       </span></th></tr><tr class=""><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8A">
  276.       <p class="TextInTable">No function</p>
  277.      </span></td><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8B">
  278.       <p class="TextInTable">-</p>
  279.      </span></td><td class="Tabelle8C2" style="text-align:left;"><span class="Tabelle8C">
  280.       <p class="TextInTable">No function will be executed.</p>
  281.      </span></td></tr><tr class=""><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8A">
  282.       <p class="TextInTable">Average</p>
  283.      </span></td><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8B">
  284.       <p class="TextInTable">AVG</p>
  285.      </span></td><td class="Tabelle8C2" style="text-align:left;"><span class="Tabelle8C">
  286.       <p class="TextInTable">Calculates the arithmetic mean of a field.</p>
  287.      </span></td></tr><tr class=""><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8A">
  288.       <p class="TextInTable">Count</p>
  289.      </span></td><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8B">
  290.       <p class="TextInTable">COUNT</p>
  291.      </span></td><td class="Tabelle8C2" style="text-align:left;"><span class="Tabelle8C">
  292.       <p class="TextInTable">Determines the number of records in the table. Empty fields can either be counted as well (a) or not (b).</p>
  293.       <p class="TextInTable">a) COUNT(*): Passing an asterisk as the argument counts all records in the table.</p>
  294.       <p class="TextInTable">b) COUNT(column): Passing a field name as an argument counts only fields in which the field name in question contains a value. Null values (empty fields) will not be counted.</p>
  295.      </span></td></tr><tr class=""><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8A">
  296.       <p class="TextInTable">Maximum</p>
  297.      </span></td><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8B">
  298.       <p class="TextInTable">MAX</p>
  299.      </span></td><td class="Tabelle8C2" style="text-align:left;"><span class="Tabelle8C">
  300.       <p class="TextInTable">Determines the highest value of a field.</p>
  301.      </span></td></tr><tr class=""><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8A">
  302.       <p class="TextInTable">Minimum</p>
  303.      </span></td><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8B">
  304.       <p class="TextInTable">MIN</p>
  305.      </span></td><td class="Tabelle8C2" style="text-align:left;"><span class="Tabelle8C">
  306.       <p class="TextInTable">Determines the lowest value of a field.</p>
  307.      </span></td></tr><tr class=""><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8A">
  308.       <p class="TextInTable">Sum</p>
  309.      </span></td><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8B">
  310.       <p class="TextInTable">SUM</p>
  311.      </span></td><td class="Tabelle8C2" style="text-align:left;"><span class="Tabelle8C">
  312.       <p class="TextInTable">Calculates the sum of values of associated fields.</p>
  313.      </span></td></tr><tr class=""><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8A">
  314.       <p class="TextInTable">Group</p>
  315.      </span></td><td class="Tabelle8A2" style="text-align:left;"><span class="Tabelle8B">
  316.       <p class="TextInTable">GROUP BY</p>
  317.      </span></td><td class="Tabelle8C2" style="text-align:left;"><span class="Tabelle8C">
  318.       <p class="TextInTable">Groups query data according to the field name selected. Functions are executed according to the specified groups. In SQL this option corresponds to the GROUP BY clause. If a criterion is added, this entry appears in the SQL HAVING.</p>
  319.      </span></td></tr></table>
  320.    <p class="Paragraph">You can also enter function calls directly in the SQL statement. The syntax is:</p>
  321.    <p class="Paragraph">SELECT FUNCTION(column) FROM table.</p>
  322.    <p class="Paragraph">For example, the function call in SQL for calculating a sum is:</p>
  323.    <p class="Paragraph">SELECT SUM("Price") FROM "Article".</p>
  324.    <p class="Paragraph">Except for the <span class="T1">Group</span> function, the above functions are so-called Aggregate functions. These are functions that calculate data to create summaries of the results. Additonal functions that are not listed in the list box are also possible. These depend on the specific database system in use. To get information about driver specific functions refer to the documentation of your database system.</p>
  325.    <p class="Paragraph">To use other functions not listed in the list box, you must enter them under <span class="T1">Field</span>. They will then appear automatically in the <span class="T1">Function</span> line.</p>
  326.    <p class="Paragraph">You can also assign aliases to function calls. If the query is not to be displayed in the column header, enter the desired name under <span class="T1">Alias</span>.</p>
  327.    <p class="Paragraph">The corresponding function in an SQL statement is:</p>
  328.    <p class="Paragraph">SELECT FUNCTION() AS alias FROM table</p>
  329.    <p class="Paragraph">Example:</p>
  330.    <p class="Paragraph">SELECT COUNT(*) AS count FROM "Item"</p>
  331.    <table><tr class="Tabelle91"><th class="Tabelle9A1" style="text-align:left;"><span class="Tabelle9A">
  332.        <p class="Paragraph"><draw:image draw:style-name="fr3" draw:name="HIND_6" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="5" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  333.       </span></th><th class="Tabelle9A1" style="text-align:left;"><span class="Tabelle9B">
  334.        <p class="Paragraph">If you run this function, you cannot insert any additional columns for the query other than receiving these columns as a "Group" function.</p>
  335.       </span></th></tr></table>
  336.    <p class="P2">Examples</p>
  337.    <p class="Paragraph">In the following example, a query is run through two tables: an "Item" table with the "Item_No" field and a "Suppliers" table with the "Supplier_Name" field. In addition, both tables have a common field name "Supplier_No."</p>
  338.    <p class="Paragraph">The following steps are required to create a query containing all suppliers who deliver more than three items.</p>
  339.    <ol class="L1">
  340.     <li class="">
  341.      <p class="P3">Insert the "Item" and "Suppliers" tables into the query design.</p>
  342.     </li>
  343.     <li class="">
  344.      <p class="P3">Link the "Supplier_No" fields of the two tables if there is not already a relation of this type.</p>
  345.     </li>
  346.     <li class="">
  347.      <p class="P3">Double-click the "Item_No" field from the "Item" table. Display the <span class="T1">Function</span> line using the context menu and select the Count function.</p>
  348.     </li>
  349.     <li class="">
  350.      <p class="P3">Enter >3 as a criterion and disable the Visible field.</p>
  351.     </li>
  352.     <li class="">
  353.      <p class="P3">Double-click the "Supplier_Name" field in the "Suppliers" table and choose the Group function.</p>
  354.     </li>
  355.     <li class="">
  356.      <p class="P3">Run the query. Done!</p>
  357.     </li>
  358.    </ol>
  359.    <p class="Paragraph">If the "price" (for the individual price of an article) and "Supplier_No" (for the supplier of the article) fields exist in the "Item" table, you can obtain the average price of the item that a supplier provides with the following query:</p>
  360.    <ol class="L2">
  361.     <li class="">
  362.      <p class="P4">Insert the "Item" table into the query design.</p>
  363.     </li>
  364.     <li class="">
  365.      <p class="P4">Double-click the "Price" and "Supplier_No" fields.</p>
  366.     </li>
  367.     <li class="">
  368.      <p class="P4">Enable the <span class="T1">Function</span> line and select the Average function from the "Price" field.</p>
  369.     </li>
  370.     <li class="">
  371.      <p class="P4">You can also enter "Average" in the line for the alias name (without quotation marks).</p>
  372.     </li>
  373.     <li class="">
  374.      <p class="P4">Choose Group for the "Supplier_No" field.</p>
  375.     </li>
  376.     <li class="">
  377.      <p class="P4">Run the query. Done!</p>
  378.     </li>
  379.    </ol>
  380.    <p class="Paragraph">The following context menu commands and symbols are available:</p>
  381.    <p class="Head3"><help:help-id value="SID_QRY_FUNCTION" xmlns:help="http://openoffice.org/2000/help"/>Functions</p>
  382.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Shows/hides a bar for functions.</help:help-text></p>
  383.    <p class="Head3"><help:help-id value="SID_QRY_TABLENAME" xmlns:help="http://openoffice.org/2000/help"/>Table Name</p>
  384.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Shows or hides the row for the table name.</help:help-text></p>
  385.    <p class="Head3"><help:help-id value="SID_QRY_ALIASNAME" xmlns:help="http://openoffice.org/2000/help"/>Alias Name</p>
  386.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Shows or hides the row for the alias name.</help:help-text></p>
  387.    <p class="Head3"><help:help-id value="SID_QRY_DISTINCT" xmlns:help="http://openoffice.org/2000/help"/>Distinct Values</p>
  388.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Activate this command to apply only distinct values to the query.</help:help-text> This concerns records containing data which appears several times in the selected fields. If the <span class="T1">Distinct Values</span> command is active, you will see only one record in the query (DISTINCT). Otherwise, you will see all records corresponding to the query criteria (ALL).</p>
  389.    <p class="Paragraph">For example, to record all the last names in your address database in a query but the name "Smith" occurs several times, you can choose the <span class="T1">Unique Values</span> command to specify in the query that the name "Smith" will occur only once.</p>
  390.    <p class="Paragraph">For a query involving several fields, the combination of values from all fields must be unique so that the result can be formed from a specific record. For example, let's say you have "Smith in Chicago" once in your address book and "Smith in London" twice. With the <span class="T1">Unique Values</span> command, the query will use the two fields "last name" and "city" and return the query result "Smith in Chicago" once and "Smith in London" once.</p>
  391.    <p class="Paragraph">In SQL this command corresponds to the DISTINCT predicate.</p>
  392.    <p class="Head3"><a name="sqlbefehle"/><help:key-word value="Formulate query criteria" tag="kw66162_13" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="Formulating filter conditions" tag="kw66162_5" xmlns:help="http://openoffice.org/2000/help"/>Formulating filter conditions</p>
  393.    <help:to-be-embedded Eid="abfragekriterien" xmlns:help="http://openoffice.org/2000/help">
  394.    <p class="Paragraph">When formulating filter conditions various operators and commands are available to you. Apart from the relational operators there are SQL-specific commands that query the content of database fields. If you use these commands in the <help:productname>%PRODUCTNAME</help:productname> syntax, <help:productname>%PRODUCTNAME</help:productname> automatically converts these into the corresponding SQL syntax. You can also enter the SQL command directly. The following tables give an overview of the operators and commands:</p>
  395.    <table border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" page-break-inside="page-break-inside:avoid"><tr class=""><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
  396.        <p class="TableHead">Operator</p>
  397.       </span></th><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
  398.        <p class="TableHead">Meaning</p>
  399.       </span></th><th class="Tabelle1C1" style="text-align:left;"><span class="Tabelle1C">
  400.        <p class="TableHead">Condition is satisfied if...</p>
  401.       </span></th></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  402.       <p class="TextInTable">=</p>
  403.      </span></td><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  404.       <p class="TextInTable">equal to</p>
  405.      </span></td><td class="Tabelle1C2" style="text-align:left;"><span class="Tabelle1C">
  406.       <p class="TextInTable">... the content of the field is identical to the indicated expression.</p>
  407.       <p class="TextInTable">The operator = will not be displayed in the query fields. If you enter a value without any operator, the operator = will be automatically adopted.</p>
  408.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  409.       <p class="TextInTable"><></p>
  410.      </span></td><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  411.       <p class="TextInTable">not equal to</p>
  412.      </span></td><td class="Tabelle1C2" style="text-align:left;"><span class="Tabelle1C">
  413.       <p class="TextInTable">... the content of the field does not correspond to the specified expression.</p>
  414.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  415.       <p class="TextInTable">></p>
  416.      </span></td><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  417.       <p class="TextInTable">greater than</p>
  418.      </span></td><td class="Tabelle1C2" style="text-align:left;"><span class="Tabelle1C">
  419.       <p class="TextInTable">... the content of the field is greater than the specified expression.</p>
  420.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  421.       <p class="TextInTable"><</p>
  422.      </span></td><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  423.       <p class="TextInTable">less than</p>
  424.      </span></td><td class="Tabelle1C2" style="text-align:left;"><span class="Tabelle1C">
  425.       <p class="TextInTable">... the content of the field is less than the specified expression.</p>
  426.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  427.       <p class="TextInTable">>=</p>
  428.      </span></td><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  429.       <p class="TextInTable">greater than or equal to</p>
  430.      </span></td><td class="Tabelle1C2" style="text-align:left;"><span class="Tabelle1C">
  431.       <p class="TextInTable">... the content of the field is greater than or equal to the specified expression.</p>
  432.      </span></td></tr><tr class=""><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  433.       <p class="TextInTable"><=</p>
  434.      </span></td><td class="Tabelle1A2" style="text-align:left;"><span class="Tabelle1A">
  435.       <p class="TextInTable">less than or equal to</p>
  436.      </span></td><td class="Tabelle1C2" style="text-align:left;"><span class="Tabelle1C">
  437.       <p class="TextInTable">... the content of the field is less than or equal to the specified expression.</p>
  438.      </span></td></tr></table>
  439.    <p class="Paragraph"/>
  440.    <table border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" page-break-inside="page-break-inside:avoid"><tr class=""><th class="Tabelle2A1" style="text-align:left;"><span class="Tabelle2A">
  441.        <p class="TableHead"><help:productname>%PRODUCTNAME</help:productname> command</p>
  442.       </span></th><th class="Tabelle2A1" style="text-align:left;"><span class="Tabelle2A">
  443.        <p class="TableHead">SQL command</p>
  444.       </span></th><th class="Tabelle2A1" style="text-align:left;"><span class="Tabelle2A">
  445.        <p class="TableHead">Meaning</p>
  446.       </span></th><th class="Tabelle2D1" style="text-align:left;"><span class="Tabelle2D">
  447.        <p class="TableHead">Condition is satisfied if...</p>
  448.       </span></th></tr><tr class=""><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  449.       <p class="TextInTable">IS EMPTY</p>
  450.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  451.       <p class="TextInTable">IS NULL</p>
  452.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  453.       <p class="TextInTable">is null</p>
  454.      </span></td><td class="Tabelle2D2" style="text-align:left;"><span class="Tabelle2D">
  455.       <p class="TextInTable">... The field name is empty. For Yes/No fields with three states, this command automatically queries the undetermined state (neither Yes nor No).</p>
  456.      </span></td></tr><tr class=""><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  457.       <p class="TextInTable">IS NOT EMPTY</p>
  458.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  459.       <p class="TextInTable">IS NOT NULL</p>
  460.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  461.       <p class="TextInTable">is not empty</p>
  462.      </span></td><td class="Tabelle2D2" style="text-align:left;"><span class="Tabelle2D">
  463.       <p class="TextInTable">... the field name is not empty.</p>
  464.      </span></td></tr><tr class=""><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  465.       <p class="TextInTable">LIKE</p>
  466.       <p class="TextInTable">(placeholder * for any number of characters</p>
  467.       <p class="TextInTable">placeholder ? for exactly one character)</p>
  468.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  469.       <p class="TextInTable">LIKE</p>
  470.       <p class="TextInTable"><help:key-word value="SQL Placeholder" tag="kw66162_12"/><help:key-word value="SQL syntax placeholder" tag="kw66162_11"/>(% placeholder for any number of characters</p>
  471.       <p class="TextInTable">Placeholder _ for exactly one character)</p>
  472.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  473.       <p class="TextInTable">is an element of</p>
  474.      </span></td><td class="Tabelle2D2" style="text-align:left;"><span class="Tabelle2D">
  475.       <p class="TextInTable">... the data field contains the indicated expression. The (*) placeholder indicates whether the expression x occurs at the beginning of (x*), at the end of (*x) or inside the field content (*x*). You can enter as a placeholder in SQL queries either the SQL % character or the familiar (*) file system placeholder in the <help:productname>%PRODUCTNAME</help:productname> interface.</p>
  476.       <p class="TextInTable">The * or % placeholder stands for any number of characters. The question mark (?) in the <help:productname>%PRODUCTNAME</help:productname> interface or the underscore (_) in SQL queries is used to represent exactly one character.</p>
  477.      </span></td></tr><tr class=""><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  478.       <p class="TextInTable">NOT LIKE</p>
  479.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  480.       <p class="TextInTable">NOT LIKE</p>
  481.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  482.       <p class="TextInTable">Is not an element of</p>
  483.      </span></td><td class="Tabelle2D2" style="text-align:left;"><span class="Tabelle2D">
  484.       <p class="TextInTable">... the field name does not contain the specified expression.</p>
  485.      </span></td></tr><tr class=""><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  486.       <p class="TextInTable">BETWEEN x AND y</p>
  487.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  488.       <p class="TextInTable">BETWEEN x AND y</p>
  489.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  490.       <p class="TextInTable">falls within the interval [x,y]</p>
  491.      </span></td><td class="Tabelle2D2" style="text-align:left;"><span class="Tabelle2D">
  492.       <p class="TextInTable">... the field name contains a value that lies between the two values x and y.</p>
  493.      </span></td></tr><tr class=""><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  494.       <p class="TextInTable">NOT BETWEEN x AND y</p>
  495.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  496.       <p class="TextInTable">NOT BETWEEN x AND y</p>
  497.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  498.       <p class="TextInTable">Does not fall within the interval [x,y]</p>
  499.      </span></td><td class="Tabelle2D2" style="text-align:left;"><span class="Tabelle2D">
  500.       <p class="TextInTable">... the field name contains a value that does not lie between the two values x and y.</p>
  501.      </span></td></tr><tr class=""><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  502.       <p class="TextInTable">IN (a; b; c...)</p>
  503.       <p class="TextInTable">Note that the semicolons are used as separators in all value lists!</p>
  504.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  505.       <p class="TextInTable">IN (a, b, c...)</p>
  506.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  507.       <p class="TextInTable">contains a, b, c...</p>
  508.      </span></td><td class="Tabelle2D2" style="text-align:left;"><span class="Tabelle2D">
  509.       <p class="TextInTable">... the field name contains one of the specified expressions a, b, c,... Any number of expressions can be specified, and the result of the query is determined by an Or link. The expressions a, b, c... can be either numbers or characters</p>
  510.      </span></td></tr><tr class=""><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  511.       <p class="TextInTable">NOT IN (a; b; c...)</p>
  512.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  513.       <p class="TextInTable">NOT IN (a, b, c...)</p>
  514.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  515.       <p class="TextInTable">does not contain a, b, c...</p>
  516.      </span></td><td class="Tabelle2D2" style="text-align:left;"><span class="Tabelle2D">
  517.       <p class="TextInTable">... the field name does not contain one of the specified expressions a, b, c,...</p>
  518.      </span></td></tr><tr class=""><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  519.       <p class="TextInTable">= TRUE</p>
  520.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  521.       <p class="TextInTable">= TRUE</p>
  522.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  523.       <p class="TextInTable">has the value True</p>
  524.      </span></td><td class="Tabelle2D2" style="text-align:left;"><span class="Tabelle2D">
  525.       <p class="TextInTable">... the field name has the value True.</p>
  526.      </span></td></tr><tr class=""><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  527.       <p class="TextInTable">= FALSE</p>
  528.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  529.       <p class="TextInTable">= FALSE</p>
  530.      </span></td><td class="Tabelle2A2" style="text-align:left;"><span class="Tabelle2A">
  531.       <p class="TextInTable">has the value false</p>
  532.      </span></td><td class="Tabelle2D2" style="text-align:left;"><span class="Tabelle2D">
  533.       <p class="TextInTable">... the field name has the value false.</p>
  534.      </span></td></tr></table>
  535.    <p class="Head3">Examples</p>
  536.    <table border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" page-break-inside="page-break-inside:avoid"><tr class=""><th class="Tabelle3A1" style="text-align:left;"><span class="Tabelle3A">
  537.        <p class="Paragraph">='Ms.'</p>
  538.       </span></th><th class="Tabelle3B1" style="text-align:left;"><span class="Tabelle3B">
  539.        <p class="Paragraph">returns field names with the field content "Ms."</p>
  540.       </span></th></tr><tr class=""><td class="Tabelle3A2" style="text-align:left;"><span class="Tabelle3A">
  541.       <p class="Paragraph">LIKE <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>'H?llo</p>
  542.      </span></td><td class="Tabelle3B2" style="text-align:left;"><span class="Tabelle3B">
  543.       <p class="Paragraph">returns field names with field content such as "give" and "gave"</p>
  544.      </span></td></tr><tr class=""><td class="Tabelle3A2" style="text-align:left;"><span class="Tabelle3A">
  545.       <p class="Paragraph">LIKE 'S*'</p>
  546.      </span></td><td class="Tabelle3B2" style="text-align:left;"><span class="Tabelle3B">
  547.       <p class="Paragraph">returns data fields with field contents such as "Sun".</p>
  548.      </span></td></tr><tr class=""><td class="Tabelle3A2" style="text-align:left;"><span class="Tabelle3A">
  549.       <p class="Paragraph">BETWEEN 10 AND 20</p>
  550.      </span></td><td class="Tabelle3B2" style="text-align:left;"><span class="Tabelle3B">
  551.       <p class="Paragraph">returns field names with field content between the values 10 and 20. (The fields can be either text fields or number fields).</p>
  552.      </span></td></tr><tr class=""><td class="Tabelle3A2" style="text-align:left;"><span class="Tabelle3A">
  553.       <p class="Paragraph">IN (1; 3; 5; 7)</p>
  554.      </span></td><td class="Tabelle3B2" style="text-align:left;"><span class="Tabelle3B">
  555.       <p class="Paragraph">returns field names with the values 1, 3, 5, 7. If the field name contains an item number, for example, you can create a query that returns the item having the specified number.</p>
  556.      </span></td></tr><tr class=""><td class="Tabelle3A2" style="text-align:left;"><span class="Tabelle3A">
  557.       <p class="Paragraph">NOT IN ('Smith')</p>
  558.      </span></td><td class="Tabelle3B2" style="text-align:left;"><span class="Tabelle3B">
  559.       <p class="Paragraph">returns field names that do not contain "Smith".</p>
  560.      </span></td></tr></table>
  561.    </help:to-be-embedded>
  562.    <p class="Paragraph"><span class="T1">Date fields</span> will be basically represented as #Date# to clearly identify them as dates. The date condition will be reproduced in the resulting SQL statement in the following ODBC - compliant way:</p>
  563.    <table border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" page-break-inside="page-break-inside:avoid"><tr class=""><td class="Tabelle14A1" style="text-align:left;"><span class="Tabelle14A">
  564.       <p class="Paragraph">Date</p>
  565.      </span></td><td class="Tabelle14B1" style="text-align:left;"><span class="Tabelle14B">
  566.       <p class="Paragraph">{D'YYYY-MM-DD'}</p>
  567.      </span></td></tr><tr class=""><td class="Tabelle14A2" style="text-align:left;"><span class="Tabelle14A">
  568.       <p class="Paragraph">Date time</p>
  569.      </span></td><td class="Tabelle14B2" style="text-align:left;"><span class="Tabelle14B">
  570.       <p class="Paragraph">{D'YYYY-MM-DD HH:MM:SS'}</p>
  571.      </span></td></tr><tr class=""><td class="Tabelle14A2" style="text-align:left;"><span class="Tabelle14A">
  572.       <p class="Paragraph">Time</p>
  573.      </span></td><td class="Tabelle14B2" style="text-align:left;"><span class="Tabelle14B">
  574.       <p class="Paragraph">{D'HH:MM:SS'}</p>
  575.      </span></td></tr></table>
  576.    <p class="Paragraph"><help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> also supports the following <span class="T1">Escape sequences</span> known from ODBC and JDBC:</p>
  577.    <table border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" page-break-inside="page-break-inside:avoid"><tr class=""><td class="Tabelle15A1" style="text-align:left;"><span class="Tabelle15A">
  578.       <p class="TextInTable">Date</p>
  579.      </span></td><td class="Tabelle15B1" style="text-align:left;"><span class="Tabelle15B">
  580.       <p class="TextInTable">{d 'YYYY-MM-DD'}</p>
  581.      </span></td></tr><tr class=""><td class="Tabelle15A2" style="text-align:left;"><span class="Tabelle15A">
  582.       <p class="TextInTable">Time</p>
  583.      </span></td><td class="Tabelle15B2" style="text-align:left;"><span class="Tabelle15B">
  584.       <p class="TextInTable">{t 'HH:MI:SS[.SS]'} <text:s text:c="2" xmlns:text="http://openoffice.org/2000/text"/>- [ ] optional</p>
  585.      </span></td></tr><tr class=""><td class="Tabelle15A2" style="text-align:left;"><span class="Tabelle15A">
  586.       <p class="TextInTable">DateTime</p>
  587.      </span></td><td class="Tabelle15B2" style="text-align:left;"><span class="Tabelle15B">
  588.       <p class="TextInTable">{ts 'YYYY-MM-DD HH:MI:SS[.SS]'} <text:s text:c="2" xmlns:text="http://openoffice.org/2000/text"/>- [ ] optional</p>
  589.      </span></td></tr></table>
  590.    <p class="Paragraph">Example: select {d '1999-12-31'} from world.years</p>
  591.    <p class="Paragraph"><span class="T1">Like </span>Escape Sequence: {escape 'escape-character'}</p>
  592.    <p class="Paragraph">Example: select * from Item where Item Name like 'The *%' {escape '*'}</p>
  593.    <p class="Paragraph">The example will give you all of the entries where the item name begins with 'The *'. This means that you can also search by characters that would otherwise by interpreted as placeholders, such as *, ?, _, % or the period.</p>
  594.    <p class="Paragraph"><span class="T1">Outer Join</span> Escape Sequence: {oj outer-join}</p>
  595.    <p class="Paragraph">Example: select Artikel.* from {oj item LEFT OUTER JOIN orders ON item.no=orders.ANR}</p>
  596.    <p class="Paragraph">Identifiers -that is, field names- should always be entered in the [Identifier] form otherwise, they will be interpreted as strings. Strings will be enclosed by single quotation marks.</p>
  597.    <p class="Head3"><help:key-word value="Querying text boxes" tag="kw66162_4" xmlns:help="http://openoffice.org/2000/help"/>Querying text boxes</p>
  598.    <p class="Paragraph">To query the content of a text box, you must put the expression between single quotation marks. No distinction is made between uppercase and lowercase letters.</p>
  599.    <p class="Head3"><help:key-word value="Querying date fields" tag="kw66162_3" xmlns:help="http://openoffice.org/2000/help"/>Querying date fields</p>
  600.    <p class="Paragraph">Even if you want to filter by a date, you must place the expression between single quotation marks. The following formats are valid: YYYY-MM-DD HH:MM:SS and YYYY/MM/DD HH:MM:SS as well as YYYY.MM.DD HH:MM:SS</p>
  601.    <p class="Head3"><help:key-word value="Querying Yes/No fields" tag="kw66162_2" xmlns:help="http://openoffice.org/2000/help"/>Querying Yes/No fields</p>
  602.    <p class="Paragraph">To query Yes/No fields, use the following syntax for dBase <help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="MAC"/><help:default> or Adabas</help:default></help:switch> tables:</p>
  603.    <table border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" page-break-inside="page-break-inside:avoid"><tr class=""><th class="Tabelle12A1" style="text-align:left;"><span class="Tabelle12A">
  604.        <p class="TableHead">Status</p>
  605.       </span></th><th class="Tabelle12A1" style="text-align:left;"><span class="Tabelle12B">
  606.        <p class="TableHead">Query criterion</p>
  607.       </span></th><th class="Tabelle12C1" style="text-align:left;"><span class="Tabelle12C">
  608.        <p class="TableHead">Example</p>
  609.       </span></th></tr><tr class=""><td class="Tabelle12A2" style="text-align:left;"><span class="Tabelle12A">
  610.       <p class="TextInTable">Yes</p>
  611.      </span></td><td class="Tabelle12A2" style="text-align:left;"><span class="Tabelle12B">
  612.       <p class="TextInTable">for dBase tables: not equal to any given value</p>
  613.      </span></td><td class="Tabelle12C2" style="text-align:left;"><span class="Tabelle12C">
  614.       <p class="TextInTable">=1 returns all records where the Yes/No field has the status "Yes" or "on" (selected in black),</p>
  615.      </span></td></tr><tr class=""><td class="Tabelle12A2" style="text-align:left;"><span class="Tabelle12A">
  616.       <p class="TextInTable">No</p>
  617.      </span></td><td class="Tabelle12B3" style="text-align:left;"><span class="Tabelle12B">
  618.       <p class="TextInTable">.</p>
  619.      </span></td><td class="Tabelle12C2" style="text-align:left;"><span class="Tabelle12C">
  620.       <p class="TextInTable">=0 returns all records for which the Yes/No field has the status "No" or "Off" (no selection).</p>
  621.      </span></td></tr><tr class=""><td class="Tabelle12A2" style="text-align:left;"><span class="Tabelle12A">
  622.       <p class="TextInTable">Null</p>
  623.      </span></td><td class="Tabelle12A2" style="text-align:left;"><span class="Tabelle12B">
  624.       <p class="TextInTable">IS NULL</p>
  625.      </span></td><td class="Tabelle12C2" style="text-align:left;"><span class="Tabelle12C">
  626.       <p class="TextInTable">IS NULL returns all records for which the Yes/No field has neither of the states Yes or No (selected in gray).</p>
  627.      </span></td></tr></table>
  628.    <p class="Paragraph"/>
  629.    <table><tr class="Tabelle131"><th class="Tabelle13A1" style="text-align:left;"><span class="Tabelle13A">
  630.        <p class="Paragraph"><draw:image draw:style-name="fr2" draw:name="HIND_8" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="6" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  631.       </span></th><th class="Tabelle13A1" style="text-align:left;"><span class="Tabelle13B">
  632.        <p class="Paragraph">The syntax to be used depends on the database system used. You should also note that Yes/No fields can be defined differently (only 2 states instead of 3).</p>
  633.       </span></th></tr></table>
  634.    <p class="Head3"><a name="parameterabfrage"/><help:key-word value="parameter queries; query designs" tag="kw66162_10" xmlns:help="http://openoffice.org/2000/help"/>parameter queries</p>
  635.    <p class="Paragraph">You must place the variable between square brackets (=[x]) to create a query with variable parameters. Alternatively, you can use an equal sign followed by a colon (=:x). When the query is executed, the program will display a dialog asking you for the expression the variable x should be assigned to.</p>
  636.    <p class="Paragraph">If you query several parameters at the same time you will see a list field in the dialog containing all of the parameters and an input line against each one. Enter the values preferably from top to bottom and press the Enter key after each line.</p>
  637.    <table><tr class="Tabelle51"><th class="Tabelle5A1" style="text-align:left;"><span class="Tabelle5A">
  638.        <p class="Paragraph"><draw:image draw:style-name="fr2" draw:name="HIND_2" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="0" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  639.       </span></th><th class="Tabelle5A1" style="text-align:left;"><span class="Tabelle5B">
  640.        <p class="Paragraph">Parameter queries with placeholders (*, _) or special characters (?, etc.) are not currently available.</p>
  641.       </span></th></tr></table>
  642.    <p class="Paragraph">If you formulate a parameter query and you save it with the variables, you can later easily create a query with which only the variables have to be replaced by the expressions that you want. <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> asks for these variables in a dialog as soon as you open the query.</p>
  643.    <p class="Head3"><help:help-id value="OFFMGR_EDIT_DLG_PARAM_ET_PARAM" xmlns:help="http://openoffice.org/2000/help"/><a name="eingabeparameter"/>Specify Parameter</p>
  644.    <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">This dialog asks you which variables you defined in the query. Enter a value for each query variable and confirm by clicking <span class="T1">OK</span>.</help:help-text></p>
  645.    <p class="Paragraph">Parameter queries are also used for <help:link Id="65955" Eid="unterformular" xmlns:help="http://openoffice.org/2000/help">subforms</help:link> since they work exclusively with queries for which the values to be invoked are read internally from a variable.</p>
  646.    <p class="Paragraph">A parameter query can have the following form in an SQL statement:</p>
  647.    <p class="Paragraph">select * from 'adresses' where 'name' = :placeholder</p>
  648.    <p class="Head2"><a name="sql"/>SQL Mode</p>
  649.    <p class="Paragraph"><help:key-word value="%PRODUCTNAME and SQL" tag="kw66162_9" xmlns:help="http://openoffice.org/2000/help"/>SQL stands for "Structured Query Language" and describes instructions for updating and administering relational databases.</p>
  650.    <p class="Paragraph">In <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> you do not need any knowledge of SQL for most queries, since you do not have to enter the SQL code. If you create a query in the query design, <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> automatically converts your instructions into the corresponding SQL syntax. If with the help of the <span class="T1">Activate/deactivate design view </span><text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>button you change to the SQL view, you can see the SQL commands for a query that has been created previously.</p>
  651.    <p class="Paragraph">You can formulate your query directly in the SQL code. Note here, however, that the special syntax is dependent upon the database system that you use. The Adabas format is based on the SQL/92 standard (often also referred to as SQL2), which was proclaimed by ISO and several national standards institutions (in particular ANSI) in 1989 and extended in 1992.</p>
  652.    <p class="Paragraph"><help:key-word value="native SQL" tag="kw66162_8" xmlns:help="http://openoffice.org/2000/help"/><help:key-word value="SQL; native SQL" tag="kw66162_7" xmlns:help="http://openoffice.org/2000/help"/>If you enter the SQL code manually, you can create SQL-specific queries that are not supported by the graphical interface in <span class="T1">Query design</span>. These queries must be executed in native SQL mode.</p>
  653.    <p class="Paragraph">By clicking the <help:link Id="65944" xmlns:help="http://openoffice.org/2000/help"><span class="T1">Execute SQL command directly</span></help:link> icon in the SQL view you can formulate a query that is not processed by <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname>.</p>
  654.    <help:to-be-embedded Eid="sqlsyntax" xmlns:help="http://openoffice.org/2000/help">
  655.    <table><tr class="Tabelle101"><th class="Tabelle10A1" style="text-align:left;"><span class="Tabelle10A">
  656.        <p class="Paragraph"><draw:image draw:style-name="fr2" draw:name="HIND_7" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="4" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  657.       </span></th><th class="Tabelle10A1" style="text-align:left;"><span class="Tabelle10B">
  658.        <p class="Paragraph">The following conventions for SQL syntax apply to databases in Adabas format: tables and column names are placed in double quotation marks and strings are identified by single quotation marks. Alias names are not marked by any further explicit means.</p>
  659.       </span></th></tr></table>
  660.    </help:to-be-embedded>
  661.   </body></html>